/*
 * UAE - The Un*x Amiga Emulator
 *
 * Autoconfig device support
 *
 * (c) 1996 Ed Hanway
 */

#pragma once

#define RTAREA_DEFAULT 0xf00000
#define RTAREA_BACKUP 0xef0000

extern uint addr(int);
extern void db(byte);
extern void dw(ushort);
extern void dl(uint);
extern uint ds_ansi(const char*);
extern uint ds(const TCHAR*);
extern byte dbg(uae_ptr);
extern void calltrap(uint);
extern void org(uint);
extern uint here();
extern uae_ptr makedatatable(uae_ptr resid, uae_ptr resname, byte type, sbyte priority, ushort ver, ushort rev);

extern void align(int);

extern volatile int uae_int_requested;
extern void set_uae_int_flag();

#define RTS 0x4e75
#define RTE 0x4e73

extern uae_ptr EXPANSION_explibname, EXPANSION_doslibname, EXPANSION_uaeversion;
extern uae_ptr EXPANSION_explibbase, EXPANSION_uaedevname, EXPANSION_haveV36;
extern uae_ptr EXPANSION_bootcode, EXPANSION_nullfunc;

extern uae_ptr ROM_filesys_resname, ROM_filesys_resid;
extern uae_ptr ROM_filesys_diagentry;
extern uae_ptr ROM_hardfile_resname, ROM_hardfile_resid;
extern uae_ptr ROM_hardfile_init;
extern uae_ptr filesys_initcode;

extern uae_ptr need_uae_boot_rom();

struct mountedinfo
{
    ulong64 size;
    bool ismounted;
    bool ismedia;
    int nrcyls;
};

extern int add_filesys_unitconfig(CConfiguration* conf, int index, TCHAR* error);

int target_get_volume_name(struct uaedev_mount_info* mtinf, const TCHAR* volumepath, TCHAR* volumename, int size, bool inserted, bool fullcheck);

extern void filesys_store_devinfo(byte*);
extern void emulib_install();
extern void expansion_init();
extern void expansion_cleanup();
extern void expansion_clear();

extern void uaegfx_install_code();

extern uint emulib_target_getcpurate(uint, uint*);